package showtime.framework.display
{
	import flash.display.Sprite;
	import flash.text.engine.ElementFormat;
	import flash.text.engine.FontDescription;
	import flash.text.engine.FontLookup;
	import flash.text.engine.TextBlock;
	import flash.text.engine.TextElement;
	import flash.text.engine.TextLine;

	public class BaseTextLine extends Sprite
	{
		private var block:TextBlock = null;
		
		private var element:TextElement = null;
		
		private var format:ElementFormat = null;
		
		private var description:FontDescription = null;
		
		public function BaseTextLine(content:String, fontName:String, size:int, color:uint)
		{
			description = new FontDescription();
			description.fontName = fontName;
			description.fontLookup = FontLookup.DEVICE;
			
			format = new ElementFormat(description);
			format.color = color;
			format.fontSize = size;
		
			element = new TextElement(content, format);			
			block = new TextBlock();
			block.content = element;
			
			var text:TextLine = block.createTextLine(null);			
			addChild(text);
			
			text.x = 0;
			text.y = text.height;
		}
	}
}